package edu.bistu.sim.xwy.blog.domain;

import com.fasterxml.jackson.annotation.JsonBackReference;

import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;

@Entity
public class CollectInfo {
    public NewsUser getCollct_user_tel() {
        return collct_user_tel;
    }

    public void setCollct_user_tel(NewsUser collct_user_tel) {
        this.collct_user_tel = collct_user_tel;
    }

    public NewsInfo getCollct_news_id() {
        return collct_news_id;
    }

    public void setCollct_news_id(NewsInfo collct_news_id) {
        this.collct_news_id = collct_news_id;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Id
    @GeneratedValue
    private int id ;

    @ManyToOne
    private NewsUser collct_user_tel;
//
    @ManyToOne
    private NewsInfo collct_news_id;

    @JsonBackReference
    @OneToMany(mappedBy = "collectInfo")
    private Set<NewsInfo> collectInfo = new HashSet<>();
}
